package P050_packageInfo;

import org.junit.Test;

import java.lang.annotation.Annotation;

/**
 * package-info
 *
 * @author xufy1
 */
public class PackageInfo {

    /**
     * 1. 提供包的整体注释
     * 2.包上标注注解 提供便利
     * 3. 声明友好类 和包内访问变量
     *
     */
    @Test
    public void test2() {

        System.out.println(PkgConst.PACAKGE_CONST);

        // 查看包注解
        String pkgName = "P050_packageInfo";
        Package pkg = Package.getPackage(pkgName);
        Annotation[] annotations = pkg.getAnnotations();
        for(Annotation an:annotations){
            if(an instanceof TestPkg){
                System.out.println("Hi,I'm the TestPkg");
            }
        }
    }
}

